
/* GCSx
** TOOLSELECT.H
**
** Tool selection popup dialogs
*/

/*****************************************************************************
** Copyright (C) 2003-2006 Janson
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
** 
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
*****************************************************************************/

#ifndef __GCSx_TOOLSELECT_H_
#define __GCSx_TOOLSELECT_H_

class ToolSelect : public Dialog {
public:
    struct ToolIconStruct {
        int id;
        int x;
        int y;
        const char* tooltip;
    };

private:
    SDL_Surface* iconSurface;
    const ToolIconStruct* tools;
    int numTools;

public:    
    // Assumes icons are 20x20
    // 4 per row
    ToolSelect(SDL_Surface* tIconSurface, int myNumTools, const ToolIconStruct* toolStructs);
    ~ToolSelect();
    
    // Returns ID of tool selected
    int run(int atX, int atY);
    
    // Returns true if found
    int isTool(int id) const;

    // Returns X/Y given a tool; returns true if found
    int getToolIcon(int id, int& iX, int& iY) const;
};

#endif

